package com.webserver.core;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class WebServerApplication {

    //提升作用域
    private ServerSocket serverSocket;

    //构造方法
    public WebServerApplication()  {
        System.out.println("正在启动服务器.....");
        try {
            serverSocket = new ServerSocket(8088);
            System.out.println("服务器启动完毕！");
        } catch (IOException e) {
            System.out.println("serverSocket异常！");
        }
    }

    //定义了socket来接收
    public void start(){
        try {
            System.out.println("客服端准备连接....");
            Socket socket = serverSocket.accept();
            System.out.println("客服端连接失败！");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        WebServerApplication server = new WebServerApplication();
        server.start();
    }
}
